<template>
  <div v-if="isVisible" class="developing-mask">
    <div class="content">
      <font-awesome-icon :icon="faPersonDigging" class="icon" />
      <p class="text">功能正在开发中...</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { computed, defineProps } from "vue";
import { storeToRefs } from "pinia";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { faPersonDigging } from "@fortawesome/free-solid-svg-icons";
import { useGlobalStore } from "@/stores/modules/global";
const globalStore = useGlobalStore();
const { previewDevlopment } = storeToRefs(globalStore);
const props = defineProps({
  metaInfo: {
    type: Object,
    default: () => ({})
  }
});
const isVisible = computed(() => {
  const isProd = import.meta.env.VITE_USER_NODE_ENV === "production";
  return isProd && props.metaInfo.isDeveloping && !previewDevlopment.value;
});
</script>

<style lang="scss" scoped>
.developing-mask {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: rgb(255 255 255 / 50%);
  backdrop-filter: blur(8px);
  border-radius: inherit; /* Inherit border-radius from parent */
  .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #606266;
    .icon {
      margin-bottom: 20px;
      font-size: 50px;
    }
    .text {
      font-size: 18px;
    }
  }
}
</style>
